/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.sisrest.dao.hibernate;

import java.util.List;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import pe.edu.upc.dew.sisrest.dao.RecetaDao;
import pe.edu.upc.dew.sisrest.model.Receta;

/**
 *
 * @author u201014509
 */
@Repository
public class RecetaDaoHibernate extends HibernateDaoSupport implements RecetaDao{

    @Autowired
    public RecetaDaoHibernate(SessionFactory sessionFactory){
        setSessionFactory(sessionFactory);
    }

    @Override
    public List<Receta> obtenerRecetas() {
        return getHibernateTemplate().find(" from Receta");
    }

}
